package com.example.zbh.dsliao.presenter;

import com.example.zbh.dsliao.db.entity.CarrouselPic;
import com.example.zbh.dsliao.db.entity.ForYouRecommend;
import com.example.zbh.dsliao.db.entity.HotSongMenu;
import com.example.zbh.dsliao.db.entity.NewSong;
import com.example.zbh.dsliao.db.entity.RadioSet;
import com.example.zbh.dsliao.db.entity.SongRecommend;
import com.example.zbh.dsliao.model.RecommendModel;
import com.example.zbh.dsliao.model.modelinterface.RecommendModelListener;
import com.example.zbh.dsliao.presenter.presenterinterface.RecommentPresenterListener;
import com.example.zbh.dsliao.ui.viewinterface.ShowDownLoaderResultListener;
import com.example.zbh.dsliao.ui.viewinterface.ShowRecommendListener;

import org.json.JSONObject;

import java.util.List;

/**
 * Created by zbh on 15/12/7.
 */
public class RecommendPresenter extends BasePresenter<ShowRecommendListener> implements RecommentPresenterListener {
    private ShowRecommendListener recommendListener;
    private RecommendModelListener recommendModelListener;


    public RecommendPresenter(ShowRecommendListener recommendListener) {
        this.recommendListener = recommendListener;
        this.recommendModelListener = new RecommendModel();


    }

    public void startCarouselConnection(String url) {
        recommendModelListener.executetCarousel(url, this);

    }

    public void startForYouRecommendConnection(String url) {
        recommendModelListener.executetForYouRecommend(url, this);


    }

    public void startHotSongMenuConnection(String url) {
        recommendModelListener.executetHotSongMenu(url, this);


    }

    public void startSongRecommendConnextion(String url) {
        recommendModelListener.executetSongRecommend(url, this);

    }

    public void startNewSongImgConnection(String url) {
        recommendModelListener.executetNewSongImg(url, this);

    }

    public void startNewSongConnection(String url) {
        recommendModelListener.executetNewSong(url, this);

    }

    public void startRadioSetConnection(String url) {
        recommendModelListener.executetRadioSet(url, this);

    }


    //发送轮播结果
    @Override
    public void sendCarouselResult(List<CarrouselPic> lists) {

        recommendListener.showCarouselResult(lists);

    }

    @Override
    public void sendForYouRecommendResult(List<ForYouRecommend> list) {
        recommendListener.showForYouRecommendResult(list);
    }

    @Override
    public void sendHotSongMenuResult(List<HotSongMenu> list) {
        recommendListener.showHotSongMenuResult(list);
    }

    @Override
    public void sendSongRecommendResult(List<SongRecommend> list) {
        recommendListener.showSongRecommendResult(list);

    }

    @Override
    public void sendNewSongImgResult(JSONObject object) {
        recommendListener.showNewSongImgResult(object);

    }

    @Override
    public void sendNewSongResult(List<NewSong> list) {
        recommendListener.showNewSongResult(list);
    }

    @Override
    public void sendRadioSetResult(List<RadioSet> list) {
        recommendListener.showRadioSetResult(list);
    }
}
